﻿using InDepth2Demo.Chapter1.C11;
using System;
using System.Collections;

namespace InDepth2Demo.Chapter1.C21
{
    /// <summary>
    /// 1.2.1 按名称对产品进行排序
    /// </summary>
    public class ProductComparerCall
    {
        static void Call()
        {
            ArrayList products = Product.GetSampleProducts();
            products.Sort(new ProductNameComparer());
            foreach (Product product in products)
            {
                Console.WriteLine(product);
            }
        }
    }
}
